package com.jsu.hotelmanagement.controller;

import com.jsu.hotelmanagement.pojo.vo.CommonResult;
import com.jsu.hotelmanagement.pojo.vo.LoginVO;
import com.jsu.hotelmanagement.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author Mo
 * @createTime 2022/12/4 19:07
 * @description 关于用户登录鉴权的接口
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    UserService userService;

    @PostMapping("/login")
    public CommonResult login(@RequestBody LoginVO loginVO, HttpServletRequest httpServletRequest) {
        return userService.login(loginVO, httpServletRequest);
    }

}
